package cn.istartfinancial.listener;


import cn.istartfinancial.entity.flowable.BaseTask;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;
import java.util.Map;

/**
 * @author: Nzp
 * @date: 2018/8/29 17:23
 * @description: 流程监听器 动态注入节点办理人
 */
public class ActStartNodeListener implements TaskListener
{
    @Override
    public void notify(DelegateTask delegateTask)
    {
        //KEY
        String nodeId = delegateTask.getTaskDefinitionKey();
        Map<String, Object> variables = delegateTask.getVariables();
        BaseTask baseTask = (BaseTask) variables.get("baseTask");
        delegateTask.setAssignee(baseTask.getUserId());
    }
}
